package com.itheima.filter;

import io.jsonwebtoken.Claims;

/**令牌解析中间类
 * @Author:上官徵羽
 * @Date: 2025/07/16 17:14
 * @Description TODO 今日内容:
 */
public class CurrentHolder {
    private static final ThreadLocal<Claims> TOKEN = new ThreadLocal<>();

    public static void setCurrentHolder (Claims claims){
        System.out.println(claims.toString());
        TOKEN.set(claims);
    }
    public static Claims getCurrentHolder (){
        return TOKEN.get();
    }
    public static void removeCurrentHolder (){
        TOKEN.remove();
    }
}
